package model;

public abstract class MarkingTreeElement {
	
	
	private final Marking marking;
	
	public Marking getMarking(){
		return this.marking;
	}
	
	public MarkingTreeElement(final Marking marking) {
		this.marking = marking;
	}

	/**
	 * Provides true if the {@link Marking} of this {@link MarkingTreeElement} or one of the {@link Marking}s above
	 * 
	 * @param marking
	 * @return
	 */
	public boolean containsSubmarkingOf(final Marking marking){
		return this.marking.containsSubmarkingOf(marking) || this.containsSubmarkingOfTransitive(marking);
	}

	public abstract boolean containsSubmarkingOfTransitive(final Marking marking);

	public boolean contains(final Marking marking) {
		return this.marking.equals(marking) || this.containsTransitive(marking);
	}

	protected abstract boolean containsTransitive(Marking marking);
	
	public abstract Marking getStartMarking();
	
}
